package StringDemo.TraverceString;

public class Example2 {
    public static void main(String[] args) {
        int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
        System.out.println(inversion(arr));
    }

    public static String inversion(int[] arr) {
        String result = "[";
        for (int i = arr.length - 1; i >= 0; i--) {
            result += arr[i];
            if (i >= 1)
                result += ',';
        }
        result += ']';
        return result;
    }
}
